<?php
	//Classe pour un logement
	class Room extends Model{

		//Constructeur
		public function __construct($idRoom,$address,$idTown,$rent,$comment,$area,$nbRoomMate,$distanceSchool,$delaySchool){
			parent::__construct('room');
			$this->idRoom=$idRoom;
			$this->address=$address;
			$this->idTown=$idTown;
			$this->rent=$rent;
			$this->comment=$comment;
			$this->area=$area;
			$this->nbRoomMate=$nbRoomMate;
			$this->distanceSchool=$distanceSchool;
			$this->delaySchool=$delaySchool;
		}
		
		//Suppression d'un logement
		public function delete(){
			parent::delete();
			RoomDB::deleteRoomDescriptionByIdRoom($this->idRoom);
		}
		
		//Retourne les valeur de caracteristique pour un logement
		public function getCharacsValues(){
			return CharacteristicDB::getCharacsValuesFromRoomId($this->idRoom);	
		}
		
	}
?>
